import request from '@/utils/request'

// 查询字典数据列表
export function getDicts(dictType) {
  const queryParams = {
    'dictType': dictType
  }
  return request({
    url: '/system/dict/data/type',
    method: 'get',
    params: queryParams
  })
}

// 查询字典数据列表
export function listData(query) {
  return request({
    url: '/system/dict/data/list',
    method: 'get',
    params: query
  })
}

// 查询字典数据详细
export function getData(id) {
  return request({
    url: '/system/dict/data/detail',
    method: 'get',
    params: { 'id': id }
  })
}

// 新增字典数据
export function addData(data) {
  return request({
    url: '/system/dict/data/add',
    method: 'post',
    data: data
  })
}

// 修改字典数据
export function updateData(data) {
  return request({
    url: '/system/dict/data/update',
    method: 'put',
    data: data
  })
}

// 删除字典数据
export function delData(ids) {
  return request({
    url: '/system/dict/data/delete/' + ids,
    method: 'delete'
  })
}
